from django.db import models

class ActionLog(models.Model):
    user =      models.ForeignKey('ChurchUser', blank = False)
    table =     models.CharField(max_length = 40, blank = False)
    rowId =     models.IntegerField(blank = False)
    rowString = models.CharField(max_length = 100)
    action =    models.CharField(max_length = 20, blank = False)
    dateTime =  models.DateTimeField()

    def __unicode__(self):
        return "%s %s: %s on %s, %s(id:%s)" % (dateTime, user, action, table, rowString, rowId)
    
    class Meta:
        app_label = 'GUI'